package com.ybb.vue.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ybb
 * @version 1.0
 * @Description 健康码状态枚举类
 * @Date 2023/3/11 19:20
 */

@Getter
@AllArgsConstructor
public enum AlarmTypeEnum {
    YELLOW_CODE_WARM("0","健康码黄码"),
    RED_CODE_WARM("1","健康码红码"),
    UNKNOWN_HEALTH_CODE_WARM("2","健康码未知弹窗"),
    NO_HEALTH_CODE_WARM("3","健康码未申领"),
    DEFAULT_CODE_WARM("-1","错误的告警类型")
    ;
    private String status;

    private String statusDesc;

    public static String getAlarmType(String code){
        for (AlarmTypeEnum it : AlarmTypeEnum.values()) {
            if (it.status.equals(code)) {
                return it.statusDesc;
            }
        }
        return DEFAULT_CODE_WARM.statusDesc;
    }
}
